//
// Created by tonystark on 16/3/31.
// Copyright (c) 2016 sewm. All rights reserved.
//

#import "BaseUIView.h"

@class YouDaoSearchResultsView;

/**
 * 搜索结果
 */
@protocol YouDaoSearchResultsViewDelegate<NSObject>

- (void)dishSearchResultsView:(YouDaoSearchResultsView *)view filterWithSearchString:(NSString *)searchString;

@optional

- (void)dishSearchResultsViewDidShow:(YouDaoSearchResultsView *)view;
- (void)dishSearchResultsViewWillHide:(YouDaoSearchResultsView *)view;
- (void)dishSearchResultsViewDidHide:(YouDaoSearchResultsView *)view;

@end

@interface YouDaoSearchResultsView : BaseUIView <UISearchBarDelegate>

@property (nonatomic, readonly) UISearchBar *searchBar;
@property (nonatomic, readonly) UITableView *searchResultsTableView;

@property (nonatomic, weak) id<YouDaoSearchResultsViewDelegate> delegate;
@property (nonatomic, weak) id<UITableViewDataSource> searchResultsDataSource;
@property (nonatomic, weak) id<UITableViewDelegate> searchResultsDelegate;

- (void)showWithBlock:(NoparamBlock)block startedPoint:(CGPoint)pt;
- (void)showInView:(UIView *)view startedPoint:(CGPoint)pt;
- (void)hide:(BOOL)animated;

@end